package com.cskaoyan.mapper;

import com.cskaoyan.bean.Cart;
import com.cskaoyan.bean.CartExample;
import com.cskaoyan.bean.cart.CheckoutData;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {
    long countByExample(CartExample example);

    int deleteByExample(CartExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    List<Cart> selectByExample(CartExample example);

    Cart selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Cart record, @Param("example") CartExample example);

    int updateByExample(@Param("record") Cart record, @Param("example") CartExample example);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

    Cart selectForCart(@Param("goodsId") Integer goodsId, @Param("productId") Integer productId);

    int updateCheckedByUserIdAndProductId(@Param("userId") Integer userId, @Param("productIds") Integer[] productIds, @Param("isChecked") Boolean isChecked);

    int deleteCart(@Param("userId") Integer userId, @Param("productIds") Integer[] productIds, @Param("deleted") Boolean deleted);

    Integer getGoodsCount(@Param("userId") Integer userId, @Param("checked") Boolean checked);

    Integer getGoodsAmount(@Param("userId") Integer userId, @Param("checked") Boolean checked);

    CheckoutData selectCheckoutData(@Param("couponId") Integer couponId, @Param("grouponRulesId") Integer grouponRulesId);
}